<?
$class_active = 'active';
$pag_act = "";
$art_act = "";
$gal_act = "";
$que_act = "";


switch ($this->router->fetch_class()){
    case "pages":
        $pag_act = $class_active;
        break;
    case "articles":
        $art_act = $class_active;
        break;
    case "galleries":
        $gal_act = $class_active;
        break;
    case "questions":
        $que_act = $class_active;
        break;
}

?>

<div id="docNav" class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse"
                    data-target=".nav-collapse">
                <span class="icon-bar"></span> <span class="icon-bar"></span> <span
                    class="icon-bar"></span>
            </button>
            <a class="brand" href="<?=site_url('pages/view_all')?>">FLAT CMS</a>
            <div class="nav-collapse collapse">
                <ul class="nav">
                    <li class="dropdown <?=$pag_act?>"><a data-toggle="dropdown"
                                                   class="dropdown-toggle" href="#">Pages <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="<?=site_url('pages/view_new_page')?>">New page </a></li>
                            <li><a href="<?=site_url('pages/view_all')?>">View all pages &nbsp;<span class="label label-important">NEW</span></a></li>
                        </ul>
                    </li>
                    <li class="dropdown <?=$art_act?>"><a data-toggle="dropdown"
                                                   class="dropdown-toggle" href="#">Articles <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="<?=site_url('articles/view_new_article')?>">New article </a></li>
                            <li><a href="<?=site_url('articles/view_all')?>">View all articles &nbsp;<span class="label label-important">NEW</span></a></li>
                        </ul>
                    </li>
                    <li class="dropdown <?=$gal_act?>"><a data-toggle="dropdown"
                                            class="dropdown-toggle" href="#">Galleries <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="<?=site_url('galleries/view_new_gallery')?>">New gallery</a></li>
                            <li><a href="<?=site_url('galleries/view_all')?>">View all galleries</a></li>
                        </ul>
                    </li>
                    <li class="dropdown <?=$que_act?>"><a data-toggle="dropdown"
                                            class="dropdown-toggle" href="#">Questions <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="<?=site_url('questions/view_all')?>">View all questions</a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav pull-right">
                    <li id="purchaseNavLink"><a
                            href="<?=site_url("login/logout")?>"><i
                                class="glyphicon icon-user"></i> Logout</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>